package com.sunjq.fetchdata.service;

import android.content.Intent;
import android.util.Log;

import com.sunjq.fetchdata.dao.FetchDataWaiShiChuDao;

public class FetchDataWaiShiChuService extends FetchDataService {

	FetchDataWaiShiChuDao fdwscd = new FetchDataWaiShiChuDao(this);


	private WaiShiChuBackendServiceImpl wscbsi = new WaiShiChuBackendServiceImpl(
			this, fdwscd);

	@Override
	public void onCreate() {
		System.out.println("startService 1");
		Log.d("WaishichuService", "onCreate 1");
		super.onCreate();
		Log.d("WaishichuService", "onCreate");
	}

	public void onDestory() {
		super.onDestroy();
		Log.d("WaishichuService", "onDestroy");
	}

	public int onStartCommand(Intent intent, int flags, int startId) {
		System.out.println("startService 2");
		Log.d("WaishichuService", "onCreate 2");
		super.onStartCommand(intent, flags, startId);
		this.setRunning(true);
		new Thread(wscbsi).start();
		return startId;

	}
}
